<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return redirect('/source');
});

Route::group(['middleware'=>'login'],function(){	

Route::get('/admin','AdminController@index');

	// 用户操作路由
	Route::resource('user','UserController');

	// 分类操作路由
	Route::resource('cate','CateController');

	// 商品操作路由
	Route::resource('goods','GoodsController');
	// 信息采集操作
	Route::get('/collection','GoodsController@collection');

	// 通知操作路由
	Route::resource('new','NewController');

	// 首页操作路由
	Route::resource('lunbo','LunboController');

	// 后台退出操作
	Route::get('/admin/logout','LoginController@logout');

	// 后台修改密码
	// Route::get('/admin/passedit','LoginController@passedit');


});

// 后台登陆
Route::get('/admin/login','LoginController@login');
Route::post('/admin/login','LoginController@dologin');

// ----------------------------------------------------------

// 前台注册
Route::get('/register','LoginController@register');
Route::post('/register','LoginController@doregister');
Route::get('/jihuo','LoginController@jihuo');

// 验证码功能
Route::get('/vcode','PublicController@vcode');



// 商品详情
Route::get('/{id}.html','GoodsController@show')->where('id',"\d+");

	
// 添加商品到购物车
	Route::post('/cart/insert','CartController@insert');
	// 购物车详情页
	Route::get('/cart','CartController@index');
	// // 购物车删除商品操作
	// Route::res('/cart-{id}','CartController@delete');
	// 添加商品到购物车
	Route::post('/order/create','OrderController@create');
	// 订单信息显示
	Route::get('/order/{order}.html','OrderController@confirm');

	// 收货地址
	Route::get('/area','AddressController@area');

	Route::post('address/insert','AddressController@insert');

	Route::post('/order/confirm','OrderController@doconfirm');



// 前台登陆
Route::get('/home/login','LoginController@hmlogin');
Route::post('/home/login','LoginController@dohmlogin');

Route::get('/source','LunboController@show');



